import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'home',
    component: HomeView
  },
  {
    path: '/menu',
    name: 'menu',
    component: () => import('../views/MenuView.vue'),
    // redirect: '/menu',
    children: [{
      path: 'detail',
      name: 'detail',
      component: () => import('../components/detailComp.vue')
    },
    {
      path: 'content',
      name: 'content',
      component: () => import('../components/contentComp.vue')
    }]
  },
  {
    path: '/order',
    name: 'order',
    component: () => import('../views/OrderView.vue')
  },
  {
    path: '/shopCar',
    name: 'shopCar',
    component: () => import('../views/ShopCarView.vue')
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../components/user/registerComp.vue')
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../components/user/loginComp.vue')
  },
  {
    path: '/my',
    name: 'my',
    component: () => import('../views/MyView.vue'),
  },
  {
    path: '/search',
    name: 'search',
    component: () => import('../components/searchComp.vue')
  },
  {
    path: '/personal',
    name: 'personal',
    component: () => import('../components/personal/personal.vue')
  },
  {
    path: '/collect',
    name: 'collect',
    component: () => import('../components/personal/collect.vue')
  },
  {
    path: '/area',
    name: 'area',
    component: () => import('../components/personal/area.vue')
  },

  {
    path: '/knowledge',
    name: 'knowledge',
    component: () => import('../components/CultureList/knowledge.vue')
  },
  {
    path: '/baking',
    name: 'baking',
    component: () => import('../components/CultureList/baking.vue')
  },
  {
    path: '/preparation',
    name: 'preparation',
    component: () => import('../components/CultureList/preparation.vue')
  },
  {
    path: '/taste',
    name: 'taste',
    component: () => import('../components/CultureList/taste.vue')
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
